package Cantella::DJabberd::Store::Result::RosterGroupItem;

use base qw/DBIx::Class::Core/;
use metaclass 'Reaction::Meta::Class';
use Moose;

use aliased 'Cantella::DJabberd::Store::Result::RosterItem';
use aliased 'Cantella::DJabberd::Store::Result::RosterGroup';

use namespace::clean -except => [ 'meta' ];

__PACKAGE__->table('roster_group_items');
__PACKAGE__->add_columns
  (
   roster_group_id => {
                       data_type => "INT",
                       size => 10,
                       is_nullable    => 0,
                       extra => { unsigned => 1 },
                       is_foreign_key => 1,
                      },
   roster_item_id  => {
                       data_type => "INT",
                       size => 10,
                       is_nullable    => 0,
                       extra => { unsigned => 1 },
                       is_foreign_key => 1,
                      },
  );
__PACKAGE__->set_primary_key(qw/roster_group_id roster_item_id/);

__PACKAGE__->belongs_to(roster_item  => RosterItem,  {id => 'roster_item_id'});
__PACKAGE__->belongs_to(roster_group => RosterGroup, {id => 'roster_group_id'});

__PACKAGE__->meta->make_immutable(inline_constructor => 0);

1;
